const Controller = require('egg').Controller
const jsonfile = require('jsonfile')
const fs = require('fs')

class DoubanController extends Controller {
  async top250() {
    const data = jsonfile.readFileSync('app/public/top250.json')
    const ctx = this.ctx
    ctx.body = data
    ctx.set('Access-Control-Allow-Origin', '*')
  }
}

module.exports = DoubanController
